/*
 * @Author: chentao
 * @Date: 2021-01-23 10:35:16
 * @Last Modified by: chentao
 * @Last Modified time: 2022-05-13 13:54:44
 *
 */
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var Person = /** @class */ (function () {
    function Person(name, age) {
        this.name = name;
        this.age = age;
        console.log(this.name, this.age);
    }
    Person.prototype.run = function () {
        console.log('this.name', this.name);
    };
    Object.defineProperty(Person.prototype, "getName", {
        get: function () {
            return this.name;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Person.prototype, "setName", {
        //ts的set跟get方法
        set: function (name) {
            this.name = name;
        },
        enumerable: false,
        configurable: true
    });
    return Person;
}());
var Student = /** @class */ (function (_super) {
    __extends(Student, _super);
    function Student(name, age) {
        return _super.call(this, name, age) || this;
    }
    return Student;
}(Person));
var p = new Person('张三', 23);
p.run();
console.log("输出name", p.getName);
p.setName = "李四";
console.log("输出setName", p.getName);
//创建Student对象
var student = new Student("student", 33);
console.log("student.getName:", student.getName);
student.f = function (name) {
    console.log("".concat(name, "\u51FD\u6570\u8C03\u7528"));
};
student.f("RNG");
function testInterface(iPerson) {
    console.log("iPerson", iPerson);
    return iPerson;
}
var iPerson = testInterface(student);
console.log(iPerson instanceof Student);
console.log(iPerson instanceof Person);
